<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('试卷信息表列表')" />
</head>
<body class="gray-bg">
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:paper:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:paper:remove')}]];
        var prefix = ctx + "system/paper";

        $(function() {
            var options = {
                url: prefix + "/list",
                modalName: "试卷信息表",
                columns: [
                {
                    field : 'paperTitle', 
                    title : '试卷标题'
                },
                {
                    field : 'totalScore', 
                    title : '试卷总分'
                },
                {
                    field : 'questionNumber', 
                    title : '试题数量'
                },
                {
                    field : 'bankId', 
                    title : '所属题库编号'
                },
                {
                    field : 'paperExplain', 
                    title : '试卷说明'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.paperId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.paperId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="authqu(\'' + row.bankId + '\')"><i class="fa fa-user"></i>添加试题</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });

        function authqu(bankId) {
            var pre=ctx + "system/question";
            var url = pre + '/authqu/' +bankId ;
            $.modal.openTab("添加试题", url);
        }
    </script>
</body>
</html>